<template>
	<view style="height: 100%;">
		<view class="centent">
			<view class="datebox" @tap="towenjuan(item.id)" v-if="gglist.length>0" v-for="(item,index) in gglist"
				:key="index">
				<view class="datecenter">
					<!-- <text>日期时间</text> -->
				</view>
				<view class="bottombox">
					<view class="bottomcenter">
						<view class="title">
							<text>{{item.name}}</text>
						</view>
						<view class="cententbox">
							<text>{{item.description}}</text>
						</view>

					</view>
				</view>
			</view>


		</view>
		<kongyemian v-if="gglist.length<1" :isLoding="loding" type="wenjuan"></kongyemian>
	</view>
</template>

<script>
	import {
		mapState,
		mapGetters,
		mapMutation,
		mapActions
	} from 'vuex';
	export default {
		computed: {
			...mapState({
				userInfo: state => state.user.userInfo,
				isLogin: state => state.user.isLogin
			})
		},
		data() {
			return {
				class_id: 0,
				gglist: [],
				school_id: 0,
				loding: true,
				company_id:0
			}
		},
		methods: {
			towenjuan(id) {
				uni.navigateTo({
					url: '../wenjuanxiangqing/wenjuanxiangqing?id=' + id + '&class_id=' + this.class_id +'&company_id=' + this.company_id
				})
			},
			wenjuanlist() {
				this.loding = true
				this.$store
					.dispatch('wenjuanlist', {
						openid: this.userInfo.openid,
						token: this.userInfo.token,
						// school_id: this.school_id,
						class_id:this.class_id,
						index:uni.getStorageSync("def"),
						company_id : this.company_id

					})
					.then(res => {
						console.log(res)
						console.log(res.data)
						this.gglist = res.data.data.list;
						this.loding = false
					});
			}



		},
		onShow() {
			this.wenjuanlist()
		},
		onLoad(data) {
			this.school_id = data.school_id
			this.class_id  = data.class_id
			this.company_id = data.company_id
		},
		onPullDownRefresh() {
			this.wenjuanlist()
			setTimeout(() => {
				uni.stopPullDownRefresh();
			}, 1500)
		}
	}
</script>

<style lang="less">
	page {
		height: 100%;
		background-color: #f4f4f4;
		box-sizing: border-box;

	}

	.centent {
		background-image: url(../../static/keding.png);
		background-size: 100% auto;
		background-repeat: no-repeat;
		width: 100%;
		height: 100%;

		.datebox {
			.datecenter {
				text-align: center;
				font-size: 28rpx;
			}

			.bottombox {
				padding: 20rpx;
				width: 100%;
				height: 220rpx;
				box-sizing: border-box;

				.bottomcenter {
					position: relative;
					width: 100%;
					height: 100%;
					background-color: #fff;
					border-radius: 15rpx;
					// box-shadow: 0rpx 4rpx 17rpx 4rpx rgba(188, 225, 237, 0.35);
					box-shadow: 0 0 10px rgba(0, 0, 0, 0.35);
					box-sizing: border-box;
					display: flex;
					flex-direction: column;
					justify-content: space-evenly;
					padding: 0 20rpx;

					.title {
						font-size: 30rpx;
						color: #4e4e4e;
					}

					.cententbox {
						font-size: 28rpx;
						color: #999999;
					}
				}
			}
		}



	}
</style>
